package Solution;

import Data.Heap;

public class HeapSort {
       public static <E extends Comparable> void headSort(E[] list){
    	   Heap<E> heap=new Heap<E>();
    	   
    	   for(int i=0;i<list.length;i++){
    		   heap.add(list[i]);
    	   }
    	   for(int i=list.length-1;i>=0;i--){
    		   list[i]=heap.remove();
    	   }
       }
}

